#include <Qevent>
#include <Qwidget>
#include <QKeyevent>

void keyPressEvent( QKeyEvent * event )
{ 
  Switch (event->key()) 
  {
     case Qt::Key_F1:
       input[0]=true;
       break;
     case Qt::Key_F2:
       input[1]=true;
       break;
     case Qt::Key_F3:
       input[2]=true;
       break;
     case Qt::Key_F4:
       input[3]=true;
       break;
     case Qt::Key_F5:
       input[4]=true;
   }
}

void keyReleaseEvent(QKeyEvent * event)
{
Switch (event ->key())
{
	case Qt::Key_F1:
		input[0]=false;
		break;
	case Qt::Key_F2:
		input[1]=false;
		break;
	case Qt::Key_F3:
		input[2]=false;
		break;
	case Qt::Key_F4:
		input[3]=false;
		break;
	case Qt::Key_F5:
		input[4]=false;
		break;
}
}	